<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>

<div id="itemsManagement">
	<h2><fmt:message key="header.itemsManagement"/></h2>
	
	<form:form modelAttribute="itemManagementBean">
		<div class="search_form">
			<div class="left_col">
				<fmt:message key="site.name"/>:
				<form:input path="itemNameFilter"/>
			</div>
			<div class="right_col">
				<fmt:message key="site.category"/>:
				<form:select path="categoryId" multiple="false">
					<option value="-1">- <fmt:message key="site.notSelected"/> -</option>
					<c:if test="${not empty categories}">
						<c:forEach var="category" items="${categories}">
							<option value="${category.id}" <c:if test="${category.id eq itemManagementBean.categoryId}">selected="selected"</c:if>>${category.name}</option>
						</c:forEach>
					</c:if>
				</form:select>
			</div>
			<div class="search_btn_col">
				<input type="image" name="_eventId_search" value="<fmt:message key="button.search"/>" src="<c:url value="/images/buttons/search_btn.PNG"/>"/>
			</div>
		</div>
	</form:form>
	
	<form:form modelAttribute="itemManagementBean">
		<div class="middle_col">
			<div>
				<label class="title"><fmt:message key="site.items"/>:</label>
			</div>
			<div class="items_holder">
				<form:select path="itemIds" multiple="multiple">
					<c:if test="${not empty items}">
						<c:forEach var="item" items="${items}">
							<option value="${item.id}">${item.name}</option>
						</c:forEach>
					</c:if>
				</form:select>
			</div>
		</div>
		<div class="btn_row">
			<input type="image" name="_eventId_add" value="<fmt:message key="button.add"/>" src="<c:url value="/images/buttons/add_btn.PNG"/>"/>
			<input type="image" name="_eventId_edit" value="<fmt:message key="button.edit"/>" src="<c:url value="/images/buttons/edit_btn.PNG"/>"/>
			<input type="image" name="_eventId_delete" value="<fmt:message key="button.delete"/>" src="<c:url value="/images/buttons/delete_btn.PNG"/>"/>
		</div>
	</form:form>
</div>